<style>
    .information p {
        text-overflow: -o-ellipsis-lastline;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    </style>
<div id="productList">
    <div class="heading">
       <!-- <a href="#"><img src="resource/images/img-17-8.jpg" /></a>-->
        <?php echo $output['title']; ?>
    </div>



<?php  if(!empty($output['bargain_list'])){ ?>
    <?php foreach($output['bargain_list'] as $k =>$v) { ?>
    <div class="commodity">

        <div class="img">

           <!-- <img class="icon" src="resource/images/img-20-1.png">-->

            <a href="index.php?act=bargain&op=bargain_info&bargain_id=<?php echo $v['bargain_id']; ?>">
            <img src="<?php echo getbargain_img($v['bg_thumb']); ?>" />
            </a>
        </div>
        <div class="information">
            <p onclick="javascript:window.location.href='index.php?act=bargain&op=bargain_info&bargain_id=<?php echo $v['bargain_id']; ?>'"><?php echo $v['bg_title']; ?></p>
            <?php if($v['is_hot'] == 1) {?>
            <span style="font-size: .8rem;">仅限<?php echo $v['bg_store'];?>份</span>
            <?php  }?>
            <p class="participants" style="font-size: 1rem;"><?php echo $v['bg_rs']; ?>人参与</p>
            <div class="price">
                <p class="originalPrice" style="font-size: 1rem;">原价 <span>￥<?php echo $v['bg_price']; ?></span>  </p>
                <p class="floorPrice" style="font-size: 1.1rem;">最低价  <span>￥<?php  echo $v['bg_floorprice'];?></span></p>
            </div>
            <a href="index.php?act=bargain&op=bargain_info&bargain_id=<?php echo $v['bargain_id']; ?>">我要参与</a>
        </div>
    </div>
    <?php } ?>
<?php } ?>






    <div style="height: 50px;"></div>
</div>
<script>

    var allNum = <?php echo $output['TotalNum']; ?>,
        allPage = <?php echo $output['TotalPage']; ?>,
        curPage = 1;

    var is_scroll = false;
    //ajax加载数据
    function loadpage() {
        if(!is_scroll){
            return;
        }
        if (curPage < allPage) {
            curPage += 1;
        } else {
            return;
        }
        $.get(location.href, {isajax:1,curpage:curPage},function(data){
            if(data){
                $(".productList").append(data);
            }
        });
    }

    $(window).scroll(function () {

        is_scroll = true;
        //已经滚动到上面的页面高度
        var scrollTop = $(this).scrollTop();
        //页面高度
        var scrollHeight = $(document).height();
        //浏览器窗口高度
        var windowHeight = $(this).height();
        //此处是滚动条到底部时候触发的事件，在这里写要加载的数据，或者是拉动滚动条的操作
        if (scrollTop + windowHeight == scrollHeight) {
            loadpage();
        }
    });
</script>

